package net.lainiao.morethread.Chapter2.demo5;

/**
 * Created by Administrator on 2017/2/28.
 */
public class Main {
    public static void main(String[] args) {
        PriceInfo priceInfo=new PriceInfo();
        Reader[] readers=new Reader[5];
        Thread[] threadReaders=new Thread[5];
        for (int i = 0; i < 5; i++) {
            readers[i]=new Reader(priceInfo);
            threadReaders[i]=new Thread(readers[i]);
        }
        Writer writer=new Writer(priceInfo);
        Thread threadWriter=new Thread(writer);
        for (int i = 0; i < 5; i++) {
            threadReaders[i].start();
        }
        threadWriter.start();
    }
}
